"""
---------------------------------------------------------------------
- File: router.py
- Date: 2025/9/22
- Author: yangzhide
- Email: xxzjyzd@126.com
- Description: 系统角色表
---------------------------------------------------------------------
"""

from tortoise import fields
from app.models.base_models import IdTimestampMixin


class Role(IdTimestampMixin):
    role_no = fields.CharField(max_length=20, unique=True, description="角色编号")
    role_name = fields.CharField(max_length=50, unique=True, description="角色名称")
    role_desc = fields.CharField(max_length=200, description="角色描述")
    status = fields.BooleanField(default=True, description="状态")

    class Meta:
        """模型元数据"""

        # 数据表名
        table = "role"
        # 表描述
        table_description = "系统用户表"
        # 索引, 可联合主键
        indexes = ("role_no",)
